<template>
  <div>
    <!-- mock模拟数据 -->
    <el-table :data="tableData" border>
      <el-table-column type="index" label="序号"></el-table-column>
      <el-table-column prop="id" label="id" align="center"></el-table-column>
      <el-table-column
        label="姓名"
        prop="username"
        align="center"
      ></el-table-column>
      <el-table-column label="头像" prop="avatar" align="center">
        <template slot-scope="scope">
          <img :src="scope.row.avatar" alt="" style="width: 100%" />
        </template>
      </el-table-column>
      <el-table-column
        label="日期"
        prop="date"
        align="center"
      ></el-table-column>
      <el-table-column
        label="描述"
        prop="description"
        align="center"
      ></el-table-column>
      <el-table-column
        label="浏览量"
        prop="pageviews"
        align="center"
      ></el-table-column>
      <el-table-column
        label="地址"
        prop="Address"
        align="center"
      ></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "MockView",
  components: {},
  data() {
    return {
      tableData: [],
    };
  },
  computed: {},
  created() {},
  mounted() {
    this.$axios
      .get("/user/userinfo")
      .then((res) => {
        console.log("res:", res.data.data);

        // this.tableData = res.data.data;
      })
      .catch((err) => {
        console.log("err:", err);
      });
    this.a();
    this.b();
  },
  methods: {
    a() {
      this.$axios
        .get("/info")
        .then((res) => {
          console.log("infores", res.data.data);
          this.tableData = res.data.data;
        })
        .catch((err) => {
          console.log("infoerr", err);
        });
    },
    b() {
      this.$axios
        .get(
          "https://mock.mengxuegu.com/mock/630c89b5c94098684fb18432/example/userinfo"
        )
        .then((res) => {
          console.log("easymock_res", res);
        })
        .catch((err) => {
          console.log("easymock_err", err);
        });
    },
  },
};
</script>

<style lang="scss" scoped></style>
